Skip to content

feat(theme): emit stability blockquotes for JSDoc stability tags#17

Merged
avivkeller merged 3 commits intowebpack:mainfrom
shivxmsharma:feat/stability-blockquotes
Mar 13, 2026
Merged

feat(theme): emit stability blockquotes for JSDoc stability tags#17
avivkeller merged 3 commits intowebpack:mainfrom
shivxmsharma:feat/stability-blockquotes

Conversation

@shivxmsharma
Copy link
Copy Markdown
Contributor

@shivxmsharma shivxmsharma commented Mar 13, 2026

Summary

Currently, members annotated with @deprecated, @experimental/@beta, or @legacy in the webpack type definitions render stability information as a plain heading (e.g. ###### Deprecated) at the bottom of the member section. This PR adds Node.js-style stability blockquotes that appear at the top of the member — before parameters and return type — following the format used in Node.js docs.

Two files are changed:

  • plugins/theme/helpers/index.mjs — adds a new stabilityBlockquote(comment) helper that inspects a TypeDoc Comment object and returns the appropriate blockquote string or null:

    • @deprecated> Stability: 0 - Deprecated[: message]
    • @experimental / @beta> Stability: 1 - Experimental
    • @legacy> Stability: 3 - Legacy[: message]
  • plugins/theme/partials/index.mjs — updates the signature() partial to prepend the stability blockquote before all other content, and passes showTags: false to ctx.partials.comment() to prevent TypeDoc from also rendering a duplicate ###### Deprecated heading.

Before:

#### Static method: `clearChunkGraphForChunk(chunk)`

* `chunk` {Chunk}
* Returns: {void}

###### Deprecated

After:

#### Static method: `clearChunkGraphForChunk(chunk)`

> Stability: 0 - Deprecated

* `chunk` {Chunk}
* Returns: {void}

Note: Members rendered via the accessor partial bypass signature() and are not covered by this change (6 cases).
Accessor-level @deprecated tags use a separate render path (accessor partial) that calls comment() directly. These 6 cases are not yet fixed. Requesting maintainer input on the preferred approach. This can be addressed in a follow-up.


What kind of change does this PR introduce?

feat


Did you add tests for your changes?

No. The project does not currently have a test suite for theme partials/helpers. The output was verified manually by regenerating docs with npm run generate-docs and inspecting the changed pages.


Does this PR introduce a breaking change?

No.


If relevant, what needs to be documented once your changes are merged or what have you already documented?

No documentation changes needed. The stability blockquote format is self-explanatory and consistent with Node.js conventions.


Use of AI

I used Claude to assist with drafting parts of the implementation. All code was reviewed and understood before committing. I have read the AI policy at https://github.com/webpack/governance/blob/main/AI_POLICY.md.

- Add stabilityBlockquote() helper in helpers/index.mjs that maps:
  @deprecated -> Stability 0, @experimental/@beta -> Stability 1,
  @legacy -> Stability 3
- Call helper at top of signature() so blockquote appears before params
- Pass showTags: false to comment() to suppress old heading-style rendering
- Regenerate pages/ with updated output (26 deprecated members fixed)

Note: accessor-level @deprecated tags use a separate render path and
are not yet handled. See PR description for details.

Closes webpack#8
Copy link
Copy Markdown
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a new line between stability blockquotes and the typed list?

@avivkeller avivkeller linked an issue Mar 13, 2026 that may be closed by this pull request
@shivxmsharma
Copy link
Copy Markdown
Contributor Author

Can you add a new line between stability blockquotes and the typed list?

Done — pushed the fix.
Please review!

@avivkeller avivkeller merged commit 5d10d62 into webpack:main Mar 13, 2026
3 checks passed
@shivxmsharma shivxmsharma deleted the feat/stability-blockquotes branch March 13, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stability Blockquotes

2 participants